#pragma once

#include <AVUIFrameworkElement.h>

namespace AVUI {

class Transform;
class Adorner : public FrameworkElement
{
	friend class AdornerLayer;
public:
    DECLARE_ELEMENT(Adorner, FrameworkElement);

	virtual TRefCountedPtr<GeneralTransform> GetDesiredTransform(GeneralTransform* pTransform) { return pTransform; };

	UIElement* get_AdornedElement() { return m_pAdornedElement; }

	bool get_IsClipEnabled() { return m_isClipEnabled; }
	void set_IsClipEnabled(bool isClipEnabled);

protected:

	Adorner(UIElement* pAdornedElement);
	virtual Size MeasureOverride(const Size& constraintSize);
    virtual TRefCountedPtr<Geometry> GetLayoutClip(const Size& layoutSlotSize) AVUI_OVERRIDE { return NULL; }

private:

	virtual bool NeedsUpdate(const Size& oldSize);

	Geometry* get_AdornerClip() { return get_VisualClip(); }
	void set_AdornerClip(Geometry* pAdornerClip) { return set_VisualClip(pAdornerClip); }

	TRefCountedPtr<Transform> get_AdornerTransform() { return get_RenderTransform(); }
	void set_AdornerTransform(Transform* pTransform) { return set_RenderTransform(pTransform); }

	TRefCountedPtr<UIElement> m_pAdornedElement;
	bool m_isClipEnabled;
};

}; // namespace AVUI


